{{useCss "/app-pages/css/user/buff.scss"}}
<div class="mainbox">
    <div class="pointitem {{$Top.$Cache.user.buff.infotype}}">
        {{#if $Cache.user.buff.bus_user_bind.length}} {{#each $Cache.user.buff.bus_user_bind}}
        <div class="items">
            <div class="item">
                <div class="i">商家:{{bus_id}}</div>
                <div class="i">推荐单数:{{achs.length}}</div>
            </div>
            <div class="item">
                <div class="i">推广:￥{{acc}}</div>
                <div class="i">红利:
                    <span class="price">￥{{#Fixed _money}}</span>
                </div>
            </div>
            <div class="item">
                {{#if state==$Top.config.bus_user_bind_status.weishenqingduihuan}} {{#if !_money}}
                <div class="info">无红利，无法申请</div>
                {{#else}}
                <a>
                    <button event-click="{{'$Top.$Event.user.buff.weishenqingduihuan_to_shenqingduihuanzhong'}}" class="btn" name="do">申请红利兑现</button>
                </a>{{/if}} {{/if}} {{#if state==$Top.config.bus_user_bind_status.shenqingduihuanzhong}}
                <div class="info">申请已发送，等待商家发款</div>
                {{/if}} {{#if state==$Top.config.bus_user_bind_status.shangjiayijingfukuan}}
                <div class="info">商家确认发款</div>
                <a>
                    <button event-click="{{'$Top.$Event.user.buff.shangjiayijingfukuan_to_yonghuquerenfukuan'}}" class="btn" name="do">确认到帐</button>
                </a>
                {{/if}}
            </div>
        </div>
        {{/each}} {{#else}}
        <p>还没有推荐过商品，赶紧去推荐商品获取收益吧</p>{{/if}}
    </div>
    <div class="pointitem">
        {{#if $Cache.user.buff.guide_list.length}} {{#each $Cache.user.buff.guide_list}}
        <div class="items">
            <div class="item">
                <div class="i">商家:{{bus_id}}</div>
                <div class="i">推荐单数:{{achs.length}}</div>
            </div>
            <div class="item">
                <div class="i">推广:￥{{acc}}</div>
                <div class="i">红利:
                    <span class="price">￥{{#Fixed _money}}</span>
                </div>
            </div>
            <div class="item">
                {{#if state==$Top.config.guide_status.weishenqingduihuan}}
                <div class="info">无红利，无法申请</div>
                {{#else}}
                <a>
                    <button event-click="{{'$Top.$Event.user.buff.guide.weishenqingduihuan_to_shenqingduihuanzhong'}}" class="btn" name="do">申请红利兑现</button>
                </a>{{/if}} {{/if}} {{#if state==$Top.config.guide_status.shenqingduihuanzhong}}
                <div class="info">申请已发送，等待商家发款</div>
                {{/if}} {{#if state==$Top.config.guide_status.shangjiayijingfukuan}}
                <div class="info">商家确认发款</div>
                <a>
                    <button event-click="{{'$Top.$Event.user.buff.guide.shangjiayijingfukuan_to_yonghuquerenfukuan'}}" class="btn" name="do">确认到帐</sbutton>
                </a>
                {{/if}}
            </div>
        </div>
        {{/each}} {{#else}}
        <p>暂无商家发放的导购链接</p>
        {{/if}}
    </div>
    <div class="pointitem">
        {{#if $Cache.user.buff.user_bina.all.length}} {{#each $Cache.user.buff.user_bina.all}}
        <div class="items">
            <div class="item">
                <div class="i">商家:{{bus_id}}</div>
                <div class="i">一级返利:
                    <span class="price">￥{{#Fixed total_first_acc}}</span>
                </div>
            </div>
            <div class="item">
                <div class="i">二级返利:
                    <span class="price">￥{{#Fixed total_second_acc}}</span>
                </div>
                <div class="i">三级返利:
                    <span class="price">￥{{#Fixed total_third_acc}}</span>
                </div>
            </div>
            <div class="item">
                <div>已兑现额度:
                    <span class="price">￥{{#Fixed exchange_acc.exchanged_acc}}</span>
                </div>
                <div>可兑现额度:
                    <span class="price">￥{{#Fixed can_apply_acc}}</span>
                </div>
            </div>
            <div class="item">
                {{#if !can_apply_acc&&!(exchange_acc.state === $Top.config.BINA_STATE.申请兑换中)&&!(exchange_acc.state === $Top.config.BINA_STATE.商家已付款)}}
                <div class="info">无可兑换额度，无法申请</div>
                {{#else}} {{#if exchange_acc.state === $Top.config.BINA_STATE.未申请兑换}}
                <button disabled="{{can_apply_acc==0}}" event-click="{{'$Top.$Event.user.buff.user_bina.未申请兑换_to_申请兑换中'}}" class="btn">申请提现</button>
                {{/if}} {{#if exchange_acc.state === $Top.config.BINA_STATE.申请兑换中}}
                <i>等待商家打款</i>
                {{/if}} {{#if exchange_acc.state === $Top.config.BINA_STATE.商家已付款}}
                <button event-click="{{'$Top.$Event.user.buff.user_bina.商家已付款_to_用户确认付款'}}" class="btn">确定收款</button>
                {{/if}} {{/if}}
            </div>
        </div>
        {{/each}} {{#else}}
        <p>还没有通过分销推荐过商品，赶紧去推荐商品获取收益吧</p>
        {{/if}}
    </div>
</div>
